package com.esl.dao.admin.impl;

import java.util.List;

import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import com.esl.dao.admin.UserDao;
import com.esl.dao.impl.CommonDaoImpl;
import com.esl.model.admin.User;

@Repository("userDao")
public class UserDaoImpl extends CommonDaoImpl<User> implements UserDao {

	@Override
	public List<User> findByName(String name) {
		String hql = "from User  where name='" + name + "'";
		return findByHql(hql);
	}

	@Override
	public List<User> checkAndReturnUser(String studentNO, String password) {
		String hql="from User where studentNO='"+studentNO+"' and password='"+password+"'";
		return findByHql(hql);
	}

	@Override
	public List<User> checkAndReturnUser(String studentNO) {
		String hql="from User where studentNO='"+studentNO+"'";
		return findByHql(hql);
	}

}
